<?php
namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Redis;
use App\Models\Yaohaorecordlist;
use App\Services\OutputService;
use App\Services\MiniappService;
use Exception,Log,Config;

class MiniController extends Controller
{
    public function msgSecCheck(Request $request)
    {
        if (empty($request->appid)) return OutputService::error("非法请求,请稍后重试！");
        $accessToken = MiniappService::getAccessToken($request->appid);
        if ($accessToken["status"] == "error") return OutputService::error("接口失败！");
        $checkResult = MiniappService::msgSecCheck($accessToken["access_token"],$request->content,,$request->openid);
        if ($checkResult) return OutputService::success("SUCCESS");
        return OutputService::error("内容存在违规!");
    }

}